home *** CD-ROM | disk | FTP | other *** search
- Path: grimsel.zurich.ibm.com!usenet
- From: wgk@zurich.ibm.com (Keith Whittingham)
- Newsgroups: comp.lang.c++
- Subject: Re: dynamic_cast costs?
- Date: 8 Mar 1996 08:05:09 GMT
- Organization: IBM Research, ZRH
- Message-ID: <4hopnl$oif@grimsel.zurich.ibm.com>
- References: <4h79hl$7lc@news.halcyon.com> <4h7prn$666@fsgi01.fnal.gov>
- Reply-To: wgk@zurich.ibm.com
- NNTP-Posting-Host: pine.zurich.ibm.com
- X-Newsreader: IBM NewsReader/2 v1.00
-
- In <4h7prn$666@fsgi01.fnal.gov>, b91926@fsgi01.fnal.gov (David Sachs) writes:
- >normanb@halcyon.com (Norm Bryar) writes:
- >
- >....
- >> Lastly, in MSVC4, I erroneously tried getting from B1 to B2 without an
- >>intermediate dynamic_cast to D in the following hierarchy:
- >
- >> class D : public B1, public B2.
- >
- >>It threw an access violation and then a "MS C++ Exception." I thought
- >>it was just supposed to return NULL if it couldn't make the cast.
- >
- >I assume you mean that you tried to cast a B1* to a B2*, where the
- >object pointed to is actually a D, and B1 has at least one virtual
- >function.
- >
- >In that case, you have encountered a compilaer limitation or bug. BCC
- >handles such a dynamic cast properly. Such a dynamic cast is in accordance
- >with the draft C++ standard.
- >--
- >***** Listen Americans, the IRS is your taxer, the IRS is one. *****
- >David Sachs - Fermilab, HPPC MS369 - P. O. Box 500 - Batavia, IL 60510
- >Voice: 1 708 840 3942 Deparment Fax: 1 708 840 3785
-
-